﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using OperaHouse.Domain.News;

namespace OperaHouse.Web.Areas.Admin.Models
{
    public class NewsItemModel
    {
        public int Id { get; set; }

        [Required]
        public string Title { get; set; }

        public string Short { get; set; }

        public string Full { get; set; }

        public bool Published { get; set; }

        public DateTime CreatedOn { get; set; }

        public static NewsItem Create(NewsItemModel model)
        {
            NewsItem news = new NewsItem();
            news.Title = model.Title;
            news.Short = model.Short;
            news.Full = model.Full;
            news.Published = model.Published;
            return news;
        }
    }
}